<extend name="Public:main" />
<block name="title">我的资产</block>
<block name="body">
<body ng-app="myApp" ng-controller="Ctrl" ng-cloak>
    <div class="nav_top flex" style="background: #0e94f5;">
        <a  href="javascript:void(0)"  onclick="window.history.go(-1)">
            <i></i>
        </a>
        <div class="flex1">
            我的资产
        </div>
        <a  href="javascript:void(0)">

        </a>
    </div>
    <div style="height: 0.44rem;"></div> 
    <div class="flex user_a_top">
        <div class="flex1">
            <label>
                余额
            </label>
            <p>
                {{ user.balance }}
            </p>
        </div>
        <div class="user_a_img">
            <i></i>
        </div>
        <div class="flex1">
            <label>
                [RMB]中国
            </label>
            <p>
                {{ user.balance }}
            </p>
        </div>
    </div>
    <p class="b_tip">
        <span>数字资产</span>
    </p>
    <div class="user_a_list">
        <ul>
            <li>
                <label>XTU</label>
                <p>{{ user.vpay }}</p>
            </li>
            <li>
                <label>比特币</label>
                <p>{{ user.bitcoin }}</p>
            </li>
            <li>
                <label>莱特币</label>
                <p>{{ user.litecoin }}</p>
            </li>
            <li>
                <label>以太坊</label>
                <p>{{ user.ethereum }}</p>
            </li>
            <li>
                <label>狗狗币</label>
                <p>{{ user.dogecoin }}</p>
            </li>
            <li>
                <label></label>
                <p></p>
            </li>
        </ul>
    </div>
    <p class="b_tip">
        <span>其他</span>
    </p>
    <div class="user_a_list">
        <ul>
            <li>
                <label>积 分</label>
                <p>{{ user.integral }}</p>
            </li>
            <!--<li>
                <label>V 宝</label>
                <p>{{ user.vcoin }}</p>
            </li>-->
        </ul>
    </div>
    <p class="b_tip red">
        <span>说明：资产的统计包含可用资产加冰冻资产</span>
    </p>
</body>
    <block name="custom_js">
        <script>
            var app = getApp('myApp', []);
            app.controller('Ctrl', function ($scope, $http) {
                $http({
                    method:'POST',
                    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
                    transformRequest: function(obj) {
                        var str = [];
                        for (var p in obj) {
                            str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
                        }
                        return str.join("&");
                    },
                    url: "/index.php/Home/Member/user_assets"
                }).then(function successCallback(response) {
                    if(response.data.code==0){
                        $scope.user = response.data.data;
                    }else {
                        layer.msg(response.data.msg)
                    }
                }, function errorCallback(response) {
                    errorHandle(response);
                });
            });
        </script>
    </block>
</block>